﻿@namespace AntDesign.Internal
@inherits AntDomComponentBase

<div class="@ClassMapper.Class" style="@(!ShowButton?"display:none;":"")">
    <span tabindex="0" class="ant-upload" style="display: grid;" @ref="_btn" data-fileid="@_fileId" role="button">
        <input type="file"
        webkitdirectory="@Directory" 
        multiple="@(Multiple || Directory)" 
        @ref="_file" 
        @onchange="FileNameChanged" 
        accept="@Accept" 
        style="@(Upload?.Drag==true?"position: absolute;width: 100%;height: 100%;opacity: 0;top: 0;left: 0;z-index:2;":"display:none;")"
        id="@_fileId" />

        @if (Upload?.Drag == true)
        {
            <div class="ant-upload-drag-container">
                 @ChildContent
            </div>
        }
        else
        {
            @ChildContent
        }
    </span>
</div>